home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Found / FWCommon / Include / FWEnvDef.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  8.6 KB  |  367 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWEnvDef.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWENVDEF_H
  11. #define FWENVDEF_H
  12.  
  13. //========================================================================================
  14. // Definitions Specific to the Build Configuration
  15. //========================================================================================
  16.  
  17. #ifndef FWBLDDEF_H
  18. #include "FWBldDef.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Wrappers for C
  23. //========================================================================================
  24.  
  25. #ifdef __cplusplus
  26.  
  27.     // C++ compilation
  28.     
  29. #define FW_EXTERN_C_BEGIN    \
  30.     extern "C" \
  31.     {
  32. #define FW_EXTERN_C_END        \
  33.     }
  34.     
  35. #else
  36.  
  37.     // Good 'ol C compilation
  38.  
  39. #define FW_EXTERN_C_BEGIN
  40. #define FW_EXTERN_C_END
  41.  
  42. #endif
  43.  
  44. //========================================================================================
  45. // Metrowerks -- Macintosh
  46. //========================================================================================
  47.  
  48. #ifdef __MWERKS__
  49.  
  50.     #ifndef FW_BUILD_MAC
  51.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  52.     #endif
  53. //    #define FW_BUILD_MAC
  54. //    #undef FW_BUILD_WIN
  55. //    #undef FW_BUILD_WIN16
  56. //    #undef FW_BUILD_WIN32
  57. //    #undef FW_BUILD_WIN32S
  58.     
  59.     #if 0x0800 <= __MWERKS__
  60.     #    if __option(exceptions)
  61.     #        define FW_NATIVE_EXCEPTIONS
  62.     #    endif
  63.     #    if __option(RTTI)
  64.     #        define FW_COMPILER_SUPPORTS_RTTI
  65.     #    endif
  66.     #endif
  67.     
  68.     #ifdef FW_BUILD_MAC68K
  69.         #ifndef FW_ODFLIB
  70.         #define FW_ODFLIB_IMPORT
  71.         #endif
  72.     #endif
  73.     
  74.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  75.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  76.     #endif
  77.     
  78.     #define ppcinterfaces 1
  79.     
  80.     #ifndef OLDROUTINENAMES
  81.     #define OLDROUTINENAMES         0
  82.     #endif
  83.     
  84.     #ifndef OLDROUTINELOCATIONS
  85.     #define OLDROUTINELOCATIONS     0
  86.     #endif
  87.     
  88.     // Hack to control what is exported from a CFM shared lib on PPC. Define functions
  89.     // with indicative names which CodeWarrior will place in the .exp file. The MPW tool
  90.     // MWExportTool will then filter the .exp removing exports between off functions and
  91.     // on functions, inclusive. The functions are dead-stripped since they are not exported
  92.     // and never referenced.
  93.     
  94.     #define FW_EXPORT_ON(file, id) \
  95.         extern "C" void _FW_export_lib_on_##file##id(); \
  96.         extern "C" void _FW_export_lib_on_##file##id() { }
  97.     #define FW_EXPORT_OFF(file, id) \
  98.         extern "C" void _FW_export_lib_off_##file##id(); \
  99.         extern "C" void _FW_export_lib_off_##file##id() { }
  100.     
  101.     #define FW_FOUR_BYTE_INTS __fourbyteints__
  102.  
  103.     #ifndef FW_BUILD_MAC68K
  104.         // Force PowerPC alignment
  105.         #pragma options align=power
  106.     #endif
  107.  
  108. //========================================================================================
  109. // Symantec C++ -- Macintosh
  110. //========================================================================================
  111. #elif defined SYMANTEC_CPLUS && !defined _WINDOWS
  112.     
  113.     #pragma options(system_includes_from_project_tree)
  114.     
  115.     #define FW_AGGRESSIVE_PRECOMPILE 1
  116.         
  117. //    #ifndef FW_USE_TEMPLATE_PRAGMAS
  118. //    #define FW_USE_TEMPLATE_PRAGMAS 1
  119. //    #endif
  120.     
  121.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  122.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  123.     #endif
  124.  
  125.     #define PRAGMA_LIB_EXPORT 1
  126.     #define PRAGMA_IMPORT 1
  127.     
  128.     #ifndef SOMLINK
  129.     #define SOMLINK
  130.     #endif
  131.     
  132.     #ifndef SOMDLINK
  133.     #define SOMDLINK
  134.     #endif
  135.     
  136.     #ifndef FW_BUILD_MAC
  137.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  138.     #endif
  139. //    #define FW_BUILD_MAC
  140. //    #undef FW_BUILD_WIN
  141. //    #undef FW_BUILD_WIN16
  142. //    #undef FW_BUILD_WIN32
  143. //    #undef FW_BUILD_WIN32S
  144.     
  145.     #define ppcinterfaces 1
  146.     
  147.     #ifndef OLDROUTINENAMES
  148.     #define OLDROUTINENAMES         0
  149.     #endif
  150.     
  151.     #ifndef OLDROUTINELOCATIONS
  152.     #define OLDROUTINELOCATIONS     0
  153.     #endif
  154.     
  155.     #define FW_EXPORT_ON
  156.     #define FW_EXPORT_OFF
  157.     
  158.     #ifndef FW_FOUR_BYTE_INTS
  159.     #define FW_FOUR_BYTE_INTS __option(int_4)
  160.     #endif
  161.  
  162.     // Force PowerPC alignment
  163.     #pragma options align=power
  164.  
  165. //========================================================================================
  166. // CFM 68K using Symantec SCpp (__SC__ would also catch SPM but that's listed above)
  167. //========================================================================================
  168. #elif defined __SC__ && !defined _WINDOWS
  169.     
  170.     #define FW_AGGRESSIVE_PRECOMPILE 1
  171.  
  172. //    #ifndef FW_USE_TEMPLATE_PRAGMAS
  173. //    #define FW_USE_TEMPLATE_PRAGMAS 1
  174. //    #endif
  175.     
  176.     #ifndef FW_ANSI_TEMPLATE_INTANTIATION
  177.     #define FW_ANSI_TEMPLATE_INTANTIATION 1
  178.     #endif
  179.  
  180.     // We want clients of the ODF library to turn on
  181.     // the import pragmas.  Define FW_ODFLIB only when building
  182.     // the ODF shared library. -  [sfu]
  183.     
  184.     #ifndef FW_ODFLIB
  185.     #define FW_ODFLIB_IMPORT
  186.     #endif
  187.         
  188.     #ifndef SOMLINK
  189.     #define SOMLINK
  190.     #endif
  191.     
  192.     #ifndef SOMDLINK
  193.     #define SOMDLINK
  194.     #endif
  195.     
  196.     #ifndef FW_BUILD_MAC
  197.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  198.     #endif
  199. //    #define FW_BUILD_MAC
  200. //    #undef FW_BUILD_WIN
  201. //    #undef FW_BUILD_WIN16
  202. //    #undef FW_BUILD_WIN32
  203. //    #undef FW_BUILD_WIN32S
  204.     
  205.     #define ppcinterfaces 1
  206.  
  207.     #ifndef OLDROUTINENAMES
  208.     #define OLDROUTINENAMES         0
  209.     #endif
  210.     
  211.     #ifndef OLDROUTINELOCATIONS
  212.     #define OLDROUTINELOCATIONS     0
  213.     #endif
  214.     
  215.     #define FW_EXPORT_ON
  216.     #define FW_EXPORT_OFF
  217.     
  218.     #ifndef FW_FOUR_BYTE_INTS
  219.     #define FW_FOUR_BYTE_INTS __option(int_4)
  220.     #endif
  221.     
  222. //========================================================================================
  223. // Mr. C -- Macintosh
  224. //========================================================================================
  225. #elif defined __MRC__
  226.  
  227.     #ifndef FW_USE_TEMPLATE_PRAGMAS
  228.     #define FW_USE_TEMPLATE_PRAGMAS 1
  229.     #endif
  230.     
  231.     // We want clients of the ODF library to turn on
  232.     // the import pragmas.  Define FW_ODFLIB only when building
  233.     // the ODF shared library. -  [sfu]
  234.     
  235.     #ifndef FW_ODFLIB
  236.     #define FW_ODFLIB_IMPORT
  237.     #endif
  238.     
  239.     #ifndef FW_BUILD_MAC
  240.     #error "FW_BUILD_MAC should have already been defined in FWBldDef.h"
  241.     #endif
  242. //    #define FW_BUILD_MAC
  243. //    #undef FW_BUILD_WIN
  244. //    #undef FW_BUILD_WIN16
  245. //    #undef FW_BUILD_WIN32
  246. //    #undef FW_BUILD_WIN32S
  247.     
  248.     #define ppcinterfaces 1
  249.  
  250.     #ifndef OLDROUTINENAMES
  251.     #define OLDROUTINENAMES         0
  252.     #endif
  253.     
  254.     #ifndef OLDROUTINELOCATIONS
  255.     #define OLDROUTINELOCATIONS     0
  256.     #endif
  257.  
  258.     #define FW_EXPORT_ON
  259.     #define FW_EXPORT_OFF
  260.     
  261.     #define FW_FOUR_BYTE_INTS 1
  262.  
  263.     // Force PowerPC alignment
  264.     #pragma options align=power
  265.  
  266. //========================================================================================
  267. // Microsoft Visual C++ - Windows
  268. //========================================================================================
  269. #elif defined _MSC_VER
  270.  
  271.     #ifdef _WINDOWS_
  272.     #error Include FWEnvDef.h before including Windows.h
  273.     #endif
  274.  
  275.     #define FW_BUILD_WIN
  276.     #define FW_BUILD_WIN32
  277.     #define FW_HAS_INSTANCE_DATA
  278.     #define FW_NATIVE_EXCEPTIONS
  279.  
  280.     #define FW_FOUR_BYTE_INTS            1
  281.     #define FW_USE_PRECOMPILED_HEADERS    1
  282.     
  283.     #ifdef _DEBUG
  284.     #define    FW_DEBUG
  285.     #endif
  286.  
  287.     #define PLATFORM_WINDOWS            1
  288.  
  289.     #define STRICT
  290.     #define WIN32_LEAN_AND_MEAN
  291.     #define WIN32_EXTRA_LEAN
  292.     #include <windows.h>
  293.  
  294.     #pragma warning(disable:4080)        // Invalid name in segment pragma
  295.     #pragma warning(disable:4660)        // Template specialization already instantiated
  296.  
  297. //========================================================================================
  298. // Symantec C++ - Windows
  299. //========================================================================================
  300. #elif defined __SC__ && defined _WINDOWS
  301.  
  302.     #ifdef _WINDOWS_
  303.     #error Include FWEnvDef.h before including Windows.h
  304.     #endif
  305.  
  306.     #define FW_BUILD_WIN
  307.     #define FW_BUILD_WIN32
  308.     #define FW_HAS_INSTANCE_DATA
  309.     #define FW_NATIVE_EXCEPTIONS
  310.  
  311.     #define FW_FOUR_BYTE_INTS            1
  312.     #define FW_AGGRESIVE_PRECOMPILE        1
  313.  
  314.     #ifdef _DEBUG
  315.     #define    FW_DEBUG
  316.     #endif
  317.  
  318.     #define PLATFORM_WINDOWS            1
  319.  
  320.     #define STRICT
  321.     #include <windows.h>
  322.     
  323.     #define SOMLINK __stdcall
  324.     #define SOMDLINK __stdcall
  325.  
  326. //========================================================================================
  327. // Unsupported Compiler
  328. //========================================================================================
  329. #else
  330.  
  331.     #error Unsupported compiler
  332.  
  333. #endif
  334.  
  335. //========================================================================================
  336. // Other Defines 
  337. //========================================================================================
  338.  
  339. #ifdef FW_BUILD_MAC
  340.     #ifndef _PLATFORM_MACINTOSH_
  341.         #define _PLATFORM_MACINTOSH_         1
  342.     #endif
  343.     #ifndef PLATFORM_MACINTOSH
  344.         #define PLATFORM_MACINTOSH             1
  345.     #endif
  346.     #if !defined(FW_HAS_INSTANCE_DATA)
  347.         #define FW_HAS_INSTANCE_DATA
  348.     #endif
  349.     
  350.     #ifdef FW_NATIVE_EXCEPTIONS
  351.     #    define _NATIVE_EXCEPTIONS_
  352.     #endif
  353.     
  354.     #define FW_EXPORT
  355. #endif
  356.  
  357. #ifdef FW_BUILD_WIN
  358.     #ifndef PLATFORM_WINDOWS
  359.         #define PLATFORM_WINDOWS             1
  360.     #endif
  361.     
  362.     #define FW_EXPORT                        __declspec(dllexport)
  363.     
  364. #endif
  365.  
  366. #endif
  367.